package files_controller_with_factory;

import static org.junit.Assert.*;
import org.junit.Ignore;
import org.junit.Test;

public class TestFactory {	
	
	@Test
	public void testgetExecute(){
		Factory f = new Factory();
		ICommandExecutor res1;
		ICommandExecutor res2;
		ICommandExecutor res3;
		ICommandExecutor res4;
		ICommandExecutor res5;
		ICommandExecutor res6;
		ICommandExecutor res7;
		ICommandExecutor res8;
		ICommandExecutor res9;
		
		res1 = f.getExecute("dir");
		res2 = f.getExecute("find");
		res3 = f.getExecute("tree");
		res4 = f.getExecute("mkdir");
		res5 = f.getExecute("copy");
		res6 = f.getExecute("delete");
		res7 = f.getExecute("move");
		res8 = f.getExecute("exit");
		res9 = f.getExecute("help");
		
		assertTrue(res1 instanceof DirCommandExecutor);
		assertTrue(res2 instanceof FindCommandExecutor);
		assertTrue(res3 instanceof TreeCommandExecutor);
		assertTrue(res4 instanceof MkdirCommandExecutor);
		assertTrue(res5 instanceof CopyCommandExecutor);
		assertTrue(res6 instanceof DeleteCommandExecutor);
		assertTrue(res7 instanceof MoveCommandExecutor);
		assertTrue(res8 instanceof ExitCommandExecutor);
		assertTrue(res9 instanceof HelpCommandExecutor);
	}
}
